//
//  LYImage.m
//  LYPhotos
//
//  Created by 美鑫科技 on 16/5/13.
//  Copyright © 2016年 MorpLCP. All rights reserved.
//

#import "LYImage.h"

@implementation LYImage

+(UIImage *)imageNamed:(NSString *)name{
    NSURL *bundlePath = [[NSBundle mainBundle] URLForResource:@"LYPhotoImage" withExtension:@"bundle"];
    NSString *path;
    NSArray *arr = [name componentsSeparatedByString:@"."];
    if (arr.count == 1) {
        path = [[NSBundle bundleWithURL:bundlePath] pathForResource:name ofType:@"png"];
    } else{
        path = [[NSBundle bundleWithURL:bundlePath] pathForResource:name ofType:nil];
    }
    UIImage *image = [UIImage imageWithContentsOfFile:path];
    return image;
}

+(UIImage *)getImageFromBundleWithName:(NSString *)imageName{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"LYPhotoImage" ofType:@"bundle"];
    UIImage *image = [UIImage imageNamed:imageName inBundle:[NSBundle bundleWithPath:path] compatibleWithTraitCollection:nil];
    return image;
}


@end
